<div id="preview-container">
loading...
</div>
<script>
const container = document.getElementById("preview-container")
// 每分钟获取一次
const fetchPreview = () => {
  fetch(`/api/preview`).then((res) => {
    const result = res.json().then(({ des }) => {
      container.innerHTML = `<img src="${des}"></img>`
    })
  })
}

fetchPreview()
let timer = 0
clearInterval(timer)
timer = setInterval(fetchPreview, 30000)
</script>